<template>
  <a-grid-item :span="{lg:12}" class="g-collapse">
    <a-collapse :default-active-key="['1']">
      <a-collapse-item header="成本核算" key="1">
        <div class="flex justify-around">
          <item title="运单总应收" :number="statistics.shipment_income"/>
          <item title="提单应付" :number="statistics?.waybill_expense"/>
          <item title="运单应付" :number="statistics?.shipment_expense"/>
          <item title="利润" :number="statistics?.profit"/>
          <item title="收费重（kg）" :number="statistics?.supplier_charge_weight"/>
          <item title="泡比" :number="statistics?.supplier_radio"/>
        </div>
      </a-collapse-item>
    </a-collapse>
  </a-grid-item>
</template>
<script setup> 
import {computed, inject, ref,watch} from "vue";
import Item from "@/views/document/waybill/components/item.vue";
import waybill from "@/api/document/waybill";
const record = inject('record')

const statistics = ref({})

const getFeeTotal = async ()=>{
  let res = await waybill.getFeeTotal(record.value.id)
  if(res.success){
    statistics.value = res.data
  }
}
getFeeTotal()
defineExpose({getFeeTotal})
</script>